package com.mytest.provider.es.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * 这里吧spu和sku合并管理
 */
@RestController
public class GoodsController {

//    @Autowired
//    private GoodsService goodsService;

    /**
     * 根据页面传入的查询条件分页查询spu商品
     *
     * @param key
     * @param saleable
     * @param page
     * @param rows
     * @return
     */
    /*@GetMapping("spu/page")
    public ResponseEntity<PageResult<SpuBo>> querySpuByPage(
            @RequestParam(value = "key", required = false) String key,
            @RequestParam(value = "saleable", required = false) Boolean saleable,
            @RequestParam(value = "page", required = false) Integer page,
            @RequestParam(value = "rows", required = false) Integer rows) {

        PageResult<SpuBo> spuPageResult = this.goodsService.querySpuByPage(key, saleable, page, rows);

        if (spuPageResult != null && null != spuPageResult.getItems() && 0 != spuPageResult.getItems().size()) {

            return ResponseEntity.ok(spuPageResult);
        }

        return ResponseEntity.status(HttpStatus.NO_CONTENT).build();

    }*/

    /*@PostMapping("goods")
    public ResponseEntity<Void> saveGoods(@RequestBody SpuBo spuBo){

        this.goodsService.saveGoods(spuBo);
        return ResponseEntity.status(HttpStatus.CREATED).build();//201

    }*/
}
